﻿@{
    Layout = null;
    ViewBag.Title = "文件导入弹窗口";
}
<link href="/Scripts/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/uploadify/swfobject.js" type="text/javascript"></script>
<script src="/Scripts/uploadify/jquery.uploadify.v2.1.4.min.js" type="text/javascript"></script>
<script type="text/javascript">

    function dialogRefresh(json) {
        DWZ.ajaxDone(json);
        if (json.statusCode == DWZ.statusCode.ok) {
            $("#pagerForm", navTab.getCurrentPanel()).submit();
            $.pdialog.closeCurrent();
        }
    }

    $("#btnImport").click(function () {

        $('#file_upload').uploadifyUpload();

    })

    $(function () {
        $('#file_upload').uploadify({
            'uploader': '/Scripts/uploadify/uploadify.swf?id=' + (new Date()).getTime(),
            'script': '@ViewBag.Url',
            'cancelImg': '/Scripts/uploadify/cancel.png',
            'folder': '/TempleterFilePath',
            //'queueID': 'List_Work_Index_FileQueue',
            //'wmode': 'transparent',
            //'fileDesc': '请选择' + '@ViewBag.Filetype' + '文件',
            //'fileExt': '@ViewBag.Filetype',
            //'sizeLimit': '@ViewBag.FileSize',
            'buttonImg': '/Scripts/uploadify/button.gif',
            'multi': false,
            'method': 'get',
            'scriptData': { 'Section': '@ViewBag.Section' },
            'onComplete': function (event, queueID, fileObj, response, data) {
                dialogRefresh(eval("(" + response + ")"));
            },
            'onError': function (event, queueID, fileObj, errorObj) {
                alertMsg.warn(errorObj.type + "Error:" + errorObj.info);
            }
        });
    });
</script>
<form id="impotExcelForm" action="@(ViewBag.Url)" method="post" enctype="multipart/form-data" class="pageForm required-validate" onsubmit="return iframeCallback(this, dialogRefresh)">
<input type="hidden" id="Section" name="Section" value="@(ViewBag.Section)" />
<div class="pageFormContent" layouth="58">
    <table class="tab01 tabNo">
        <tr>
            <td class="td1" style="width:25%;">附件：</td>
            <td>
                <input type="file" name="file_upload" id="file_upload"  multiple="false" class="required" size="30" />
            </td>
        </tr>
    </table>
</div>
<div class="formBar">
    <ul>
        <li>
            <button type="button" id="btnImport" class="btn btn-sm">
                导入</button>
        </li>
        <li>
            <button type="button" class="close btn btn-default btn-sm">
                取消</button>
        </li>
    </ul>
</div>
</form>
